﻿using System;

namespace HomeworkInterface
{
    public class Person
    {
        private string name;
        private int age;
        public Person(string name, int age)
        {
            this.name = name;
            this.age = age;
        }
    }
    public interface IHomeworkCollector
    {
        void CollectHomework();
    }
    public class Student : Person, IHomeworkCollector
    {
        private int grade;
        public Student(string name, int age, int grade): base(name, age)
        {
            this.grade = grade;
        }
        public void CollectHomework()
        {
            Console.WriteLine("报告老师！作业收集完毕！");
        }
    }
    public class Teacher : Person, IHomeworkCollector
    {
        public Teacher(string name, int age, int salary): base(name, age)
        {
            this.salary = salary;
        }
        private double salary;
        public void CollectHomework()
        {
            Console.WriteLine("同学们，请交作业！");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Student stu = new Student("小明", 18, 88);
            Teacher teacher = new Teacher("曲一线", 18, 88);
            stu.CollectHomework();
            teacher.CollectHomework();
        }
    }
}
